Skip to content

Label run headers with the GEMC run number, not Geant4's internal run ID#151

Open
zhaozhiwen wants to merge 1 commit into
gemc:mainfrom
zhaozhiwen:fix/104-run-id-counter
Open

Label run headers with the GEMC run number, not Geant4's internal run ID#151
zhaozhiwen wants to merge 1 commit into
gemc:mainfrom
zhaozhiwen:fix/104-run-id-counter

Conversation

@zhaozhiwen

Copy link
Copy Markdown
Collaborator

GRunHeader is built from aRun->GetRunID(), Geant4's internal counter (0, 1, 2, … per /run/beamOn). It is unrelated to the GEMC conditions run number the user requested (the key of runEvents in EventDispenser), so run-level output and per-run logging were mislabeled — run weights dispatching runs 11/12/13 produced headers reporting 0/1/2.

Seed Geant4's run-ID counter with the GEMC run number before each beamOn via G4RunManager::SetRunIDCounter, so aRun->GetRunID() returns the intended number. Under MT the master manager propagates the ID to the worker runs of that beamOn, keeping master and worker headers consistent.

GetRunID() is consumed only by the run header (two sites in gRunAction.cc), so seeding the counter has no other side effects.

Validation: eventDispenser.cc compiles clean (Geant4 11.4.1 dev container).

Fixes #104

GRunHeader is built from aRun->GetRunID(), which is Geant4's internal
counter starting at 0 and incrementing per /run/beamOn. It has no
relation to the GEMC conditions run number the user requested (the key of
runEvents in EventDispenser), so run-level output and per-run logging were
mislabeled — e.g. run weights dispatching runs 11/12/13 produced headers
reporting 0/1/2.

Seed Geant4's run-ID counter with the GEMC run number before each beamOn
via G4RunManager::SetRunIDCounter, so aRun->GetRunID() returns the
intended run number. Under MT the master manager propagates the ID to the
worker runs of that beamOn, keeping master and worker headers consistent.
GetRunID() is only consumed by the run header (two sites in gRunAction.cc),
so seeding the counter has no other side effects.

Fixes gemc#104

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[High] Run header stores the Geant4 internal run ID instead of the GEMC run number

1 participant